package com.hx.petsever.controller;

import com.hx.petsever.config.Result;
import com.hx.petsever.entity.Goods;
import com.hx.petsever.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/goods")
@CrossOrigin(origins="http://localhost:9999")
public class GoodsController {
    @Autowired
    GoodsService goodsService;

    @RequestMapping("/getAll")
    public Result getAll()
    {
        Result<Object> result = new Result<>();
        result.setData(goodsService.getAll());
        result.success();
        return result;
    }
}
